#ifndef SKTTIMER_H
#define SKTTIMER_H

#include <QDialog>
#include <QTimer>
#include <QPoint>
#include <QMouseEvent>

namespace Ui {
class PersonalSpeachTimerDlg;
}

class PersonalSpeachTimerOverDlg;
enum SpeachStep
{
    SpeachFirst = 0,
    SpeachDelay = 1,
    SpeachTalking = 2,
    SpeachFinished = 3
};

class PersonalSpeachTimerDlg : public QDialog
{
    Q_OBJECT


public:
    explicit PersonalSpeachTimerDlg(QWidget *parent = 0);
    ~PersonalSpeachTimerDlg();
    
public:
    void reject();

    void SetLCDNumColor(const QString & iColor);

    void SetTimeCount(double time);

    void SetTimeDelay(double time);

    void SetTimeWhole(double time);
 private:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);

 private
    slots:

    void InitNumber();

    void NextStep();

    void OnClose();

    void OnFinishSpeach();

    void OnStartTalking();

    void Pause();

    void ShowTime();

    void Start();

    void SubTime();


private:
    Ui::PersonalSpeachTimerDlg *ui;
    int                         m_TimeCount;
    int                         m_DelayCount;
    int                         m_DelayCountTotal;
    int                         m_WholeCount;// for whole speach .Kevin Yang(2013-11-27)
    QTimer                  *   m_pTimer;
    bool                        m_pause;
    PersonalSpeachTimerOverDlg          *   m_pTimeOverDlg;
    int                         m_PosX;
    SpeachStep                  m_Step;
    double                      m_Punish; // punish.Kevin Yang(2013-12-3)
    double                      m_PunishTarget;// punish target.Kevin Yang(2013-12-3)
    QPoint                      dPos; //Position.Kevin Yang(2013-12-2)
};

#endif // SKTTIMER_H
